import React, { Component } from 'react'

// 引入 father 组件
import Father from './Father';
import axios from 'axios'
export default class Grandfather extends Component {
    state = {
        schoolArr: []  // 定义学校的数组
    }
    render() {
        const { schoolArr } = this.state
        return (
            <div>
                {/* 使用father.jsx */}
                <Father schoolArr={schoolArr}></Father>
            </div>
        )
    };
    componentDidMount() {
        // 进行数据请求
        axios.get('https://api.i-lynn.cn/college?page=1').then(res => {
            console.log(res);
            this.setState({
                schoolArr: res.data.data.list1
            })
        })
    }
}
